<?php

class ButtonControl extends ValueControl {
  
  private $onclick;
  public function WithOnClick($value){$this->onclick=$value; return $this; }

  private $issubmit = false;
  public function WithIsSubmit($value){$this->issubmit=$value; return $this; }
  
  private $isreset = false;
  public function WithIsReset($value){$this->isreset=$value; return $this; }
  
  private $isdisabled = false;
  public function WithIsDisabled($value){ $this->isdisabled=$value; return $this; }
  
  public function Render(){
  	$type = 'button';
  	if ($this->issubmit) $type = 'submit';
  	elseif ($this->isreset) $type = 'reset';
    echo '<input type="'.$type.'" id="'.$this->name.'" name="'.$this->name.'" value="'.$this->value.'" onclick="'.$this->onclick.'"'.($this->isdisabled?' class="formButtonDisabled" disabled="disabled"':' class="formButton"').'/>';
  }

}

?>